package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liuc
 * @date 2021/6/3
 * @description
 **/
@RestController
public class UserController {

    @Autowired
    private IUserService userService;

    @GetMapping(value = "/user", produces = "application/json;charset=utf-8")
    public User getUser(int id){
        System.out.println("request for /user, id =  " + id);
        return userService.getById(id);
    }
}
